package com.itheima.App;

import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.sql.SQLException;
public class app5 {
    public static void main(String[] args) {


        ApplicationContext app = new ClassPathXmlApplicationContext("application-druid.xml");
        DataSource dataSource = (DataSource) app.getBean("dataSource");
        UserMapper userMapper = (UserMapper) app.getBean("userMapper");
        User user = userMapper.findByID(1);
        System.out.println(user);
    }
}